// var baseUrl = environment() ? "https://web.chathot.me/" : "http://test.chathot.me/"
var baseUrl = environment() ? "https://webv1.whoisamy.shop/" : "http://test.chathot.me/"
const API = {
    // 星空诗人初赛
    api_request: baseUrl + "app/index.php?i=6&c=entry&m=db_play&do=api_request"
}

var api_request = function(data) {
    var sureData = {
        "Api_name": 'index_active_rank',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}

var api_activity = function(data) {
    var sureData = {
        "Api_name": 'activity',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}

var api_prize = function(data) {
    var sureData = {
        "Api_name": 'prize',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}



var api_invite = function(data) {
    var sureData = {
        "Api_name": 'invite',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}



var api_third_recharge = function(data) {
    var sureData = {
        "Api_name": 'third_recharge',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}




var activity_daily = function(data) {
    var sureData = {
        "Api_name": 'activity_daily',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}



var api_list = function(data) {
    var sureData = {
        "Api_name": 'list',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}


var index_query = function(data) {
    var sureData = {
        "Api_name": 'index_query',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}


var api_activity_task = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_task',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}


var api_ludo = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'ludo',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}

var api_domino = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'domino',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}

var api_activity_list = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_list',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}


var api_activity_game = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_game',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}

var api_activity_duty = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_duty',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}

var api_activity_country = function(data) {
    data.user_id = GetUrlParam('user_id');
    data.token = GetUrlParam('token');
    var sureData = {
        "Api_name": 'activity_country',
        "Api_data": JSON.stringify(data)
    }
    return ajax('GET', API.api_request, sureData)
}